package com.ruoyi.tianliangedu.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.tianliangedu.domain.TianliangFatherSection;
import com.ruoyi.tianliangedu.mapper.TianliangFatherSectionMapper;
import com.ruoyi.tianliangedu.service.ITianliangFatherSectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 父类章节Service业务层处理
 *
 * @author lsj
 * @date 2021-07-12
 */
@Service
public class TianliangFatherSectionServiceImpl implements ITianliangFatherSectionService {
    @Autowired
    private TianliangFatherSectionMapper tianliangFatherSectionMapper;

    /**
     * 查询父类章节
     *
     * @param fatherSectionId 父类章节ID
     * @return 父类章节
     */
    @Override
    public TianliangFatherSection selectTianliangFatherSectionById(Long fatherSectionId) {
        return tianliangFatherSectionMapper.selectTianliangFatherSectionById(fatherSectionId);
    }

    /**
     * 查询父类章节列表
     *
     * @param tianliangFatherSection 父类章节
     * @return 父类章节
     */
    @Override
    public List<TianliangFatherSection> selectTianliangFatherSectionList(TianliangFatherSection tianliangFatherSection) {
        return tianliangFatherSectionMapper.selectTianliangFatherSectionList(tianliangFatherSection);
    }

    /**
     * 新增父类章节
     *
     * @param tianliangFatherSection 父类章节
     * @return 结果
     */
    @Override
    public int insertTianliangFatherSection(TianliangFatherSection tianliangFatherSection) {
        return tianliangFatherSectionMapper.insertTianliangFatherSection(tianliangFatherSection);
    }

    /**
     * 修改父类章节
     *
     * @param tianliangFatherSection 父类章节
     * @return 结果
     */
    @Override
    public int updateTianliangFatherSection(TianliangFatherSection tianliangFatherSection) {
        return tianliangFatherSectionMapper.updateTianliangFatherSection(tianliangFatherSection);
    }

    /**
     * 删除父类章节对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTianliangFatherSectionByIds(String ids) {
        return tianliangFatherSectionMapper.deleteTianliangFatherSectionByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除父类章节信息
     *
     * @param fatherSectionId 父类章节ID
     * @return 结果
     */
    @Override
    public int deleteTianliangFatherSectionById(Long fatherSectionId) {
        return tianliangFatherSectionMapper.deleteTianliangFatherSectionById(fatherSectionId);
    }
}
